<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Ver Orden"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="Identificador"/>
                    <h:outputText value="#{orderOmsController.selected.orderid}" title="Identificador"/>
                    <h:outputText value="Tarjeta de Credito"/>
                    <h:outputText value="#{orderOmsController.creditCard}" title="Tarjeta de Credito"/>
                    <h:outputText value="Fecha de Orden"/>
                    <h:outputText value="#{orderOmsController.selected.orderdate}" title="Fecha">
                        <f:convertDateTime pattern="yyyy/MM/dd" />
                    </h:outputText>
                    <h:outputText value="Precio"/>
                    <h:outputText value="#{orderOmsController.selected.orderprice}" title="Precio"/>
 
                    <h:outputText value="Estado"/>
                    <h:outputText value="#{orderOmsController.status}" title="Estado"/>
                    
                    <h:outputText value="Comentarios"/>
                    <h:outputText value="#{orderOmsController.selected.ordercomments}" title="Comentarios"/>
                    
                    <h:outputText value="Fecha de Entrega"/>
                    <h:outputText value="#{orderOmsController.selected.estimateddelivery}" title="Fecha de Entrega">
                        <f:convertDateTime pattern="yyyy/MM/dd" />
                    </h:outputText>
                    <h:outputText value="Empresa de Entrega"/>
                    <h:outputText value="#{orderOmsController.shippingCompany}" title="Empresa de Entrega"/>
                    <h:outputText value="Cliente"/>
                    <h:outputText value="#{orderOmsController.customer}" title="Cliente"/>
                    <h:outputText value="Direccion"/>
                    <h:outputText value="#{orderOmsController.address}" title="Direccion"/>
                </h:panelGrid>
                
                <br />
                 <b><label>Cotizaciones</label></b>    
                <br />
                <h:outputText escape="false" value="No se encuentran Cotizaciones" rendered="#{orderOmsController.lstOrderQuoteSize == 0 }"/>
                <h:panelGroup rendered="#{orderOmsController.lstOrderQuoteSize > 0}">
                    <h:dataTable value="#{orderOmsController.lstOrderQuote}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Con Existencias"/>
                            </f:facet>
                            <h:outputText value="SI"  rendered="#{item.hasexistences == 1}" />
                            <h:outputText value="NO"  rendered="#{item.hasexistences != 1}" />
                        </h:column>
                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Seleccionado"/>
                            </f:facet>
                             <h:outputText value="SI"  rendered="#{item.isselected == 1}" />
                            <h:outputText value="NO"   rendered="#{item.isselected != 1}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Valor Cotizacion"/>
                            </f:facet>
                            <h:outputText value="#{item.quoteprice}"/>
                        </h:column>
                       
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Proveedor"/>
                            </f:facet>
                            <h:outputText value="#{item.supplierid.suppliername}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
                
                <br />
                <h:commandLink action="#{orderOmsController.viewDetail}" value="Ver Detalle"/>   
                <br />
                <br />
                <h:commandLink action="#{orderOmsController.destroyAndView}" value="Elimiar Orden"/>
                <br />
                <br />
                <h:commandLink action="Edit" value="Editar Orden"/>
                <br /> 
                <br />
                <h:commandLink action="#{orderOmsController.prepareList}" value="Ver Ordenes"/>
                <br />
                <br />
                <h:commandLink value="Ir a Menu Principal" action="/index" immediate="true" />
                <br /> 
                <br />
                <h:commandLink action="#{orderOmsController.prepareCreate}" value="Crear Orden"  style="display:none"/>
                

            </h:form>
        </ui:define>
    </ui:composition>

</html>
